﻿using SAEA.MVC;
using KeydbCommand.Services;

namespace KeydbCommand.Controllers
{
    public class ConsoleController : Controller
    {
        /// <summary>
        /// 发送命令
        /// </summary>
        /// <param name="name"></param>
        /// <param name="cmd"></param>
        /// <returns></returns>
        public ActionResult SendCmd(string name, string cmd)
        {
            return Content(new ConsoleService().SendCmd(name, cmd)); 
        }

        /// <summary>
        /// 获取输入的命令
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public ActionResult GetCMD(string input)
        {
            return Json(new ConsoleService().GetCMD(input));
        }
    }
}
